<?php 
class database{
	var $type ='';
	
	public function database() {  
	   	$serveur = "localhost";
		$login = "root";
		$password = "root";
		$db="insta";
		mysql_connect($serveur, $login, $password);
		mysql_select_db($db); 
   }
 
   public function exec($q){
   		$rs = mysql_query($q);
   		$returnSelect = false;
		
   		if(ereg("SELECT",$q)){
	          while($row = mysql_fetch_assoc($rs))
	              $returnSelect[] = $row;
		}
		
	              
	              
		if(is_array($returnSelect))
		  return $returnSelect;
		else
			return mysql_insert_id();
   }

	public function getSingleton (){
		return true;
	}
	
	
}

?>